package SmartMeeting.commands;

import SmartMeeting.Entity.Meeting;
import SmartMeeting.facades.MeetingSystem;

public class CancelCommand implements Command {
    private MeetingSystem meetingSystem;
    private Meeting meeting;
    private CreateCommand createCommand;
    private String type;

    public CancelCommand(MeetingSystem meetingSystem, CreateCommand createCommand, String type) {
        this.meetingSystem = meetingSystem;
        this.createCommand = createCommand; // 获取创建的会议
        this.type = type;
    }

    @Override
    public void execute() {
        this.meeting = createCommand.getCreatedMeeting();
        meetingSystem.endMeeting(meeting, type);
    }

    @Override
    public void undo() {
        System.out.println("撤销会议取消命令");
    }
}
